package conf

import (
	"path"
	"generalhandler/utils"
	"fmt"
)

type UrlUniqConfig struct {
	BloomSvrHost string `json:"bloom_svr_host"`
	Timeout int `json:"timeout"`
}

var uuc *UrlUniqConfig
func UrlUniqConfigInstance() *UrlUniqConfig {
	return uuc
}

func LoadUrlUniqConf() {
	path := path.Join(utils.GetSelfBinDirPath(), "urluniq.config")
	if err := utils.LoadJsonFromFile(path, &uuc); nil != err {
		panic(fmt.Sprintf("failed to load urluniq config, cuz %s", err.Error()))
	}
}
